﻿@{
    Layout = null;

    var order = ViewData["model"] as Pay.DTO.order_dto;
    var domain = ViewData["url"] as string;

}
<html>

<head>
    <meta charset="UTF-8">
    <title>订单详情</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <meta name="format-detection" content="telphone=no, email=no" />
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <meta name="msapplication-tap-highlight" content="no">
    <link rel="stylesheet" type="text/css" href="~/Content/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="~/Content/css/gelunbu.css" />
</head>

<body style="background: #F0F0F0;">
    <div class="glb_wraper">
        <div class="order_detail">
            <div class="order_detail_top">
                <i class="icon_order_success"></i> @Pay.Core.EnumExtensions.ToDescription((order.status))
            </div>
            <div class="consignee">
                <div class="consig_left"></div>
                <div class="consig_right">
                    <div class="consig_name">
                        收货人：@order.shipping.ship_to @order.shipping.phone
                    </div>
                    <p class="consig_rg_adress">地址：@order.shipping.region_name  @order.shipping.address</p>
                    <p class="sfz_Id">@order.shipping.id_card</p>
                </div>
                <div class="clear" style="clear: both;"></div>
                <div class="sfz_Img">
                    <a href="javascript:;" class="sfz_Img_z sfz_img_list"></a>
                    <a href="javascript:;" class="sfz_Img_f sfz_img_list"></a>
                </div>
                <div class="clear" style="clear: both;"></div>
            </div>
            @if (order.order_items != null && order.order_items.Count > 0) {
                foreach (var item in order.order_items) {
                    var src = domain + item.product.first_image;
            <div class="order_detail" style="padding:0 10px;background: #fff; height: 120px; margin-top: 10px; ">
                <img src="@src" alt="">
                <section class="order_detil_box">
                    <h1 class="proTit">@(item.product.name.Length > 10 ? item.product.name.Substring(0, 10) : item.product.name)</h1>
                    <p></p>
                </section>
                <div class="order_price"><span>￥@item.product.price</span> <strong>x @item.quantity</strong></div>
            </div>
                }
            }


            <ul class="od_item">
                @*<li>运费： <span class="od_price">海外直邮：$@ViewData["postfeemoney"]</span></li>
            <li>税费： <span class="od_price">$@ViewData["customsduty"]</span></li>*@
                <li class="od_border_top">订单总计： <span class="od_price">$@System.Decimal.Round(order.pay_amount, 2) </span></li>

            </ul>
            <div class="od_state">
                <p>订单编号：@order.pay_info.order_no</p>
                <p>下单时间：@order.pay_info.create_time</p>
            </div>
            @if (order.status == Pay.TO.OrderStatus.Finish) {
        <div class="od_bottom">
            <a href="javascript:;" onclick="Pay('@order.pay_info.order_no')" class="again_btn">再次购买</a>
            <a href="javascript:;" onclick="cancel('@order.id')">删除订单</a>
        </div>
}
            @if (order.status == Pay.TO.OrderStatus.WaitPay) {
        <div class="od_bottom">
            <a href="javascript:;" onclick="Pay('@order.pay_info.order_no')" class="again_btn">付款</a>
            <a href="javascript:;" onclick="cancel('@order.id')">删除订单</a>
            </div>
            }
        </div>
        </div>
</body>
</html>
<script src="~/Content/js/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="~/Content/js/web.js"></script>
<script type="text/javascript">
    function Pay(payno) {
        ajax({
            url: '/CheckOut/Pay',
            data: { pay_no: payno },
            actions:'system'
        });
    }
    function cancel(id) {
        ajax({
            url: '/Order/Cancel',
            data: { Id: id },
            actions:'refresh'
        });
    }
</script>

